<?php
/**
 * Formulaire de creation de liste de diffusion
 * @author Etienne AUDOUIN <etienne.audouin@ingesup.com>
 * @author Adrien MARIANELLI <adrien.marianelli@ingesup.com>
 * @version 1.0
 * @package view_mailinglist_create
 */
$formAttributes = array ('id' => 'form_createMailinglist');
$listContactAttributes = array();
$listNameAttributes = array('name'=>'input_listName');

echo form_fieldset('Create a new mailinglist');
echo form_open('webnews/createMailinglist', $formAttributes);
echo '<table id="table_createMailinglist">';
// name
foreach ($contacts as $contact){
    $listContactAttributes[$contact->id] = $contact->first_name." ".$contact->name;
}
echo '<tr>';
echo '<th>Name</th>';
echo '<td>'.form_input($listNameAttributes).'</td>';
echo '</tr>';

echo '<tr>';
echo '<th> Contact to add *</th>';
echo '<td>'.  form_multiselect('multi_listContact[]', $listContactAttributes).'</td>';
echo '</tr>';
echo '</table>';

echo form_submit(null, 'Create');
echo form_close();
echo '<small>* Press <strong class="key">Maj</strong> or <strong class="key">Ctrl</strong> to select multiple contacts</small>';
echo form_fieldset_close();
?>